/**
 *
 */
package com.naiterui.ehp.bp.support.security;

import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author mudou
 * @since 2.12.0
 */
public class B2cLoginInterceptor extends AbstractLoginInterceptor {

    private static final Logger LOGGER = LoggerFactory.getLogger(B2cLoginInterceptor.class);

    @Override
    protected void printAccessLog(HttpServletRequest request) {

        String origin = request.getHeader(HeaderConstant.HEADER_ORIGIN);
        String inner = request.getHeader(SettingConfig.HEADER_INNER);
        String platform = request.getHeader(HeaderConstant.HEADER_PLATFORM);
        String version = request.getHeader(HeaderConstant.HEADER_VERSION);
        String h5Version = request.getHeader(HeaderConstant.HEADER_NATIVE_VERSION);
        String url = request.getServletPath();

        String doctorId = request.getParameter(SettingConfig.DOCTOR_ID);
        String patientId = request.getParameter(SettingConfig.PATIENT_ID);
        String token = request.getParameter(SettingConfig.TOKEN);

        LOGGER.info("==请求平台来源_p={}, _o={}, 版本号_v={}, _nv={}, inner={}, 请求路径url={}, 请求参数===doctorId={},patientId={},token={}", platform, origin,
                version, h5Version, inner, url, doctorId, patientId, token);
    }

    @Override
    protected final void settingNosignUri(List<String> nosignUri) {
        // swagger
        nosignUri.add("/swagger-ui.html");
        nosignUri.add("/webjars/**");
        nosignUri.add("/swagger-resources/**");
        nosignUri.add("/v2/api-docs");

    }
}
